﻿using System;
using System.Collections.Generic;
using System.Text;
using Barbar.MapReport.Common.Drawing;
using Barbar.MapReport.Common.Drawing.Commands;
using Barbar.MapReport.HtmlRender.Operations;

namespace Barbar.MapReport.HtmlRender {
  internal class Renderer : IRenderer {
    private RenderingContext m_Context;

    public Renderer(RenderingContext context) {
      if (context == null)
        throw new ArgumentNullException("context");

      m_Context = context;
    }

    #region IRenderer Members

    public void AddGraphs(AddGraphsCommand addGraphsCommand) {
      new AddGraphsOperation(addGraphsCommand).Render(m_Context);
    }

    public void AddLines(AddLinesCommand addLinesCommand) {
      new AddLinesOperation(addLinesCommand).Render(m_Context);
    }

    public void AddRegionsWithBusinessProcessing(AddRegionsWithBusinessProcessingCommand addRegionsWithBusinessProcessingCommand) {
      new AddRegionsWithBusinessProcessingOperation(addRegionsWithBusinessProcessingCommand).Render(m_Context);
    }

    public void AddRegionsWithFixColor(AddRegionsWithFixColorCommand addRegionsWithFixColorCommand) {
      new AddRegionsWithFixColorOperation(addRegionsWithFixColorCommand).Render(m_Context);
    }

    public void AddValueIndicators(AddValueIndicatorsCommand addValueIndicatorsCommand) {
      new AddValueIndicatorsOperation(addValueIndicatorsCommand).Render(m_Context);
    }

    public void AddDynamicValueIndicators(AddDynamicValueIndicatorsCommand addDynamicValueIndicatorsCommand) {
      new AddDynamicValueIndicatorsOperation(addDynamicValueIndicatorsCommand).Render(m_Context);
    }

    #endregion
  }
}
